<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>登录</title>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <%@include file="../includes/common.jsp" %>
</head>
<body style="padding: 0;">
<div class="container">
    上传成功！！
    <!-- /loginBox -->
</div>
 <div>
     <ul id="menuTree" class="ztree">aa</ul>
 </div>
<div><iframe src="" height="800" width="1000" id="frame"></iframe></div>

<!-- /container -->
</body>
</html>
<script>

    var settingMenu = {
        view: {
            expandSpeed: "fast"
        },
        check: {
            enable: true,
            chkStyle: "checkbox",
            chkboxType: { "Y": "p", "N": "s" }
        },
        data: {
            simpleData: {
                enable: true,
                idKey: "id",
                pIdKey: "pId"
            },
            key: {
                name: "name"
            },
            keep: {
                parent: true
            }
        },
        callback:{
           onClick:nodeClick
        }
    };


    var zNodes = [
        <c:forEach var="scormNode" items="${scormNodes}">
        {id: "${scormNode.nodeId}",
            pId: "${scormNode.parentId}",
            name: "${scormNode.nodeTitle}",
            scourl: "${scormNode.url}"
        },
        </c:forEach>
    ];

    $(function () {
        $.fn.zTree.init($("#menuTree"), settingMenu, zNodes);
        var treeObj = $.fn.zTree.getZTreeObj("menuTree");
        treeObj.expandAll(true);
    });

    function nodeClick(event, treeId, treeNode){
            var scoUrl= basePath+treeNode.scourl.substring(treeNode.scourl.lastIndexOf("scorms")-1);
            $("#frame").attr("src",scoUrl);
    }

</script>
